fn hello():void! {
    println('hello nature')
    throw errorf('hello error')
}

fn main():void! {
    hello() catch err {
        println('catch err:', err.msg())
    }

    // closure fn
    var world = fn(bool e):int! {
        if e {
            throw errorf('world error')
        }
        return 233
    }

    int foo = world(true) catch err {
        println('catch err:', err.msg())
        12
    }
    println('foo =', foo)

    foo = world(false) catch err {
        println('catch err:', err.msg())
        12
    }
    println('foo =', foo)


    // return
    hello() catch err1 {
        throw errorf('??' + err1.msg())
    }
}
